package com.atguigu.bean.zqk.bean.dao.impl;

import com.atguigu.bean.zqk.bean.bean.User;
import com.atguigu.bean.zqk.bean.dao.BaseDao;
import com.atguigu.bean.zqk.bean.dao.UserDao;

public class UserDaoimpl extends BaseDao<User> implements UserDao {

    @Override
    public User login(String username, String password) {
        String sql = "select * from bs_user where username =? and password =?";
        return getBean(User.class,sql,username,password);
    }

    @Override
    public User checkUsernme(String username) {
        String sql = "select * from bs_user where username = ?";
        return getBean(User.class,sql,username);
    }

    @Override
    public void registUser(User user) {
        String sql = "insert into  bs_user values(null,?,?,?)";
        update(sql, user.getUsername(), user.getPassword(), user.getEmail());
    }


}
